-
Notifications
You must be signed in to change notification settings - Fork 79
Workaround for Uno-exposed IDisposable errors in release mode #377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workaround for Uno-exposed IDisposable errors in release mode #377
Conversation
|
@Arlodotexe isn't their an open Uno issue on this too, can we find that and link the url to the comment in the config too? I didn't see it linked on our board, so if there is one we should add it there for tracking too: Windows Community Toolkit (view) |
Going back to the original comments from @jeromelaban and looking through open Uno issues, I wasn't able to find an existing issue for this. |
|
@Arlodotexe, want to open one so we can link it to all the places and track then? I know @jeromelaban mentioned it'd take a version to fix or something as it'd be a breaking change. Not sure if he meant a 4.8 or a 5.0 sort of thing though. |
|
@michael-hawker |
|
@jeromelaban Wouldn't it be better for Uno to suppress this warning from the nuget package, if the end user doesn't need to dispose of these? Is that something that's been investigated before? |
|
@Arlodotexe It could be something possible, though it would be a general exclusion of that warning regardless of the location. Unless I'm mistaken, this happens at the reference site and I don't think analyzers allow this kind of flexibility. |
|
Random idea I had based on this discussion and the Marquee PR. We could use the Uno props file to only ignore the warning for Uno builds, like this: Labs-Windows/common/MultiTarget/Uno.props Lines 23 to 26 in 10640a3
If there's still a disposable issue it should be flagged from UWP/WinAppSDK bits still, but at least not flag it for other places based on this type of issue, eh? |
I like this idea. If we globally-suppress only on Uno, this error will show on the UWP / WinAppSDK heads instead, and users won't have to manually suppress anything for their control like MarqueeText did. The only problem with this I can foresee is that a component which exclusively targets Uno won't see this error and may end up with a memory leak. All of our components target UWP or WinAppSDK, so this isn't a problem for now. We'll move forward with this as a workaround. |
This PR is a hotfix for all components that may use a Storyboard. Our CI treats all warnings as errors in release mode, so this has been suppressed until Uno can fix it.
From here: